package com.hxd.otc.common;


import com.hxd.otc.R;
import com.hxd.otc.utils.UIUtils;

public class ApiConstants {

    public static String BASE_URL = UIUtils.getContext().getResources().getString(R.string.main_base_url);
    public static final String STAND_01_HOST = "http://192.168.0.38/bbex/v1/";// 开发环境 47.74.239.58
    public static final String TEST_HOST = "http://192.168.0.38/bbex/v1/";//测试环境  http://o2423l9776.wicp.vip:8888  外网可以访问的测试环境
    public static final String FORMAL_TEST_HOST = "http://47.74.239.58/bbex/v1/";//发给客户的环境 测试环境
    public static String FORMAL_HOST = "http://" + BASE_URL + "/bbex/v1/";//发给客户的环境 正式环境//这个 不能写成 final ，需要动态改变

    //图片
    public static final String UPLOAD_IMAGE_HOST = "http://images.uescoin.com/";//图片上传
    public static final String SERVICE_IMAGE_BASE_URL = "https://use-images.oss-cn-shenzhen.aliyuncs.com/";//图片基本路径

    //远程支付
    public static final String REMOTE_DEVELOP = "http://192.168.0.8/payadmin/";//远程支付（开发环境）
    public static final String REMOTE_TEST = "http://192.168.0.8/payadmin/";//远程支付（内部测试环境）
    public static final String REMOTE_FORMAL_TEST = "http://47.74.239.58/payadmin/";//远程支付（客户测试环境）
    public static String REMOTE_FORMAL = "http://" + BASE_URL + "/payadmin/";//远程支付（正式环境）

    //H5
    public static final String URL_H5 = "http://" + BASE_URL + "/wotc/";//H5基本路径
    //    public static final String URL_H5 = "http://47.74.239.58/wotc/";//H5基本路径
    //    public static final String URL_H5 = "http://www.hqotc.cn/help/";
    public static String URL_OF_HELP = URL_H5 + "help.html";//正式
    public static String URL_OF_GOOGLE_CERTIFICATION = URL_H5 + "otc_google.html";//谷歌认证说明
    public static String URL_OF_OTC_ADVER_APPLY = URL_H5 + "otc_adverapply.html";//广告商协议
    public static String URL_OF_OTC_USER_PROTOCOL = URL_H5 + "otc_userprotocol.html";//注册协议

    public static String URL_OF_SHARE = "http://" + BASE_URL + "/payweb/#/inviteindex?code=";//分享推广地址
//    public static final String URL_OF_SHARE = "http://47.74.239.58/payweb/#/inviteindex?code=";//分享推广地址


    /**
     * 注意：每次新增一个单独的 URL，都需在这里设值
     *
     * @param baseUrl
     */
    public static void setUrl(String baseUrl) {
        BASE_URL = baseUrl;
        FORMAL_HOST = "http://" + baseUrl + "/bbex/";//发给客户的环境 正式环境//这个 不能写成 final ，需要动态改变
        REMOTE_FORMAL = "http://" + BASE_URL + "/payadmin/";//远程支付（正式环境）
        URL_OF_SHARE = "http://" + BASE_URL + "/payweb/#/inviteindex?code=";//分享推广地址

        String URL_H5 = "http://" + BASE_URL + "/wotc/";//H5基本路径
        URL_OF_HELP = URL_H5 + "help.html";//正式
        URL_OF_GOOGLE_CERTIFICATION = URL_H5 + "otc_google.html";//谷歌认证说明
        URL_OF_OTC_ADVER_APPLY = URL_H5 + "otc_adverapply.html";//广告商协议
        URL_OF_OTC_USER_PROTOCOL = URL_H5 + "otc_userprotocol.html";//注册协议
    }

    /**
     * 获取对应的host
     *
     * @param hostType host类型
     * @return host
     */
    public static String getHost(int hostType) {
        String host;
        switch (hostType) {
            case HostType.HOST_TEST:
                host = TEST_HOST;
                break;
            case HostType.HOST_FORMAL:
                host = FORMAL_HOST;
                break;
            case HostType.HOST_FORMAL_TEST:
                host = FORMAL_TEST_HOST;
                break;
            case HostType.HOST_STAND_01:
                host = STAND_01_HOST;
                break;
            case HostType.HOST_REMOTE_FORMAL:
                host = REMOTE_FORMAL;
                break;
            case HostType.HOST_REMOTE_TEST:
                host = REMOTE_TEST;
                break;
            case HostType.HOST_REMOTE_DEVELOP:
                host = REMOTE_DEVELOP;
                break;
            case HostType.HOST_REMOTE_FORMAL_TEST:
                host = REMOTE_FORMAL_TEST;
                break;
            case HostType.HOST_UPLOAD_IMAGE:
                host = UPLOAD_IMAGE_HOST;
                break;
            default:
                host = TEST_HOST;
                break;
        }
        return host;
    }
}
